package com.yqg.manage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yqg.manage.entity.FrontFiveBags;
import com.yqg.manage.mapper.FrontFiveBagsMapper;
import com.yqg.manage.service.IFrontFiveBagsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * FrontFiveBagsServiceImpl 服务实现类
 * @author zxf
 * @since 2025-08-06
 */
@Service
public class FrontFiveBagsServiceImpl extends ServiceImpl<FrontFiveBagsMapper, FrontFiveBags> implements IFrontFiveBagsService {
    @Resource
    private FrontFiveBagsMapper frontFiveBagsMapper;

    @Override
    public Map<String, Object> pageList(Integer pageNum, Integer pageSize, String status, String name) {
        pageNum = (pageNum - 1 ) * pageSize;
        Map<String, Object> map = new HashMap<>();
        List<FrontFiveBags> frontFiveBagsList = frontFiveBagsMapper.getPageList(pageNum,pageSize,status,name);
        Integer count = frontFiveBagsMapper.getPageListCount(status,name);
        map.put("records",frontFiveBagsList);
        map.put("total",count);
        return map;
    }
}
